<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Cacti," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;说明：cacti 需要 apache 和 php 的支持，在这里使用 yum 安装 lamp 环境。 1.安装 epel1[root@cacti ~]# yum install -y epel-release 2.安装 lamp1[root@cacti ~]# yum install -y httpd">
<meta name="keywords" content="Cacti">
<meta property="og:type" content="article">
<meta property="og:title" content="cacti 安装">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/Cacti/1. cacti 安装/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;说明：cacti 需要 apache 和 php 的支持，在这里使用 yum 安装 lamp 环境。 1.安装 epel1[root@cacti ~]# yum install -y epel-release 2.安装 lamp1[root@cacti ~]# yum install -y httpd">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/01.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/02.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/03.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/04.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/05.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/06.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/07.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/08.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/09.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/10.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/11.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/12.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/13.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/14.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/15.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/16.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/17.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/18.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/19.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/20.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/21.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/22.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/23.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/24.png?raw=true">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/25.png?raw=true">
<meta property="og:updated_time" content="2017-09-01T08:45:25.862Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="cacti 安装">
<meta name="twitter:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;说明：cacti 需要 apache 和 php 的支持，在这里使用 yum 安装 lamp 环境。 1.安装 epel1[root@cacti ~]# yum install -y epel-release 2.安装 lamp1[root@cacti ~]# yum install -y httpd">
<meta name="twitter:image" content="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/01.png?raw=true">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/Cacti/1. cacti 安装/"/>





  <title>cacti 安装 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/Cacti/1. cacti 安装/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">cacti 安装</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T02:00:30+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;说明：cacti 需要 apache 和 php 的支持，在这里使用 yum 安装 lamp 环境。</p>
<h2 id="1-安装-epel"><a href="#1-安装-epel" class="headerlink" title="1.安装 epel"></a>1.安装 epel</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># yum install -y epel-release</span></div></pre></td></tr></table></figure>
<h2 id="2-安装-lamp"><a href="#2-安装-lamp" class="headerlink" title="2.安装 lamp"></a>2.安装 lamp</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel</span></div></pre></td></tr></table></figure>
<h2 id="3-安装-cacti"><a href="#3-安装-cacti" class="headerlink" title="3.安装 cacti"></a>3.安装 cacti</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]# yum install -y cacti net-snmp net-snmp-utils rrdtool</div></pre></td></tr></table></figure>
<h2 id="4-启动服务"><a href="#4-启动服务" class="headerlink" title="4.启动服务"></a>4.启动服务</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># /etc/init.d/httpd start</span></div><div class="line">[root@cacti ~]<span class="comment"># /etc/init.d/mysqld start</span></div><div class="line">[root@cacti ~]<span class="comment"># /etc/init.d/snmpd start</span></div></pre></td></tr></table></figure>
<h2 id="5-编辑-httpd-conf"><a href="#5-编辑-httpd-conf" class="headerlink" title="5.编辑 httpd.conf"></a>5.编辑 httpd.conf</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># vim /etc/httpd/conf.d/cacti.conf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;把 “Deny from all” 改为 “Allow from all”</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># /etc/init.d/httpd restart</span></div></pre></td></tr></table></figure>
<h2 id="6-导入数据创建-cacti-库"><a href="#6-导入数据创建-cacti-库" class="headerlink" title="6.导入数据创建 cacti 库"></a>6.导入数据创建 cacti 库</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># mysql -uroot -e "create database cacti"</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;创建 cacti 用户</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># mysql -uroot -e "grant all on cacti.* to 'cacti'@'127.0.0.1' identified by 'cacti';"</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;导入 sql 文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># mysql -uroot cacti &lt; /usr/share/doc/cacti-1.0.4/cacti.sql</span></div></pre></td></tr></table></figure>
<h2 id="7-编辑-cacti-配置文件"><a href="#7-编辑-cacti-配置文件" class="headerlink" title="7.编辑 cacti 配置文件"></a>7.编辑 cacti 配置文件</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># vim /usr/share/cacti/include/config.php</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;更改如下</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$database_type</span> = <span class="string">"mysql"</span>;</div><div class="line"><span class="variable">$database_default</span> = <span class="string">"cacti"</span>;</div><div class="line"><span class="variable">$database_name</span> = <span class="string">"cacti"</span>;</div><div class="line"><span class="variable">$database_hostname</span> = <span class="string">"127.0.0.1"</span>;</div><div class="line"><span class="variable">$database_username</span> = <span class="string">"cacti"</span>;</div><div class="line"><span class="variable">$database_password</span> = <span class="string">"cacti"</span>;</div><div class="line"><span class="variable">$database_port</span> = <span class="string">"3306"</span>;</div><div class="line"><span class="variable">$database_ssl</span> = <span class="literal">false</span>;</div></pre></td></tr></table></figure>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/01.png?raw=true" alt="01"></p>
<h2 id="8-web-访问-cacti-并安装"><a href="#8-web-访问-cacti-并安装" class="headerlink" title="8.web 访问 cacti 并安装"></a>8.web 访问 cacti 并安装</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;浏览器访问  <a href="http://ip/cacti/" target="_blank" rel="external">http://ip/cacti/</a></p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/02.png?raw=true" alt="02"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;出现错误</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/03.png?raw=true" alt="03"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;执行命令</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># set time_zone = '+8:00';</span></div><div class="line">[root@cacti ~]<span class="comment"># mysql -u root mysql -p -e "GRANT SELECT ON mysql.time_zone_name TO cacti@localhost IDENTIFIED BY 'cacti';"</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;继续报错</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/04.png?raw=true" alt="04"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;编辑</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># vim /etc/php.ini</span></div></pre></td></tr></table></figure>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/05.png?raw=true" alt="05"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改为</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/06.png?raw=true" alt="06"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;执行命令</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root mysql -p</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;解决问题</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/07.png?raw=true" alt="07"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;报错</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/08.png?raw=true" alt="08"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;首先要升级 mysql 版本</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;更新 yum 源</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># yum update</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;添加 mysql5.6 yum 源</p>
<ul>
<li>centos6</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm</span></div></pre></td></tr></table></figure>
<ul>
<li>centos7</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后 yum 安装 mysql 就是 5.6 版本了</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;版本更换后</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/09.png?raw=true" alt="09"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;根据提示 修改 /etc/my.cnf 配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># vim /etc/my.cnf</span></div></pre></td></tr></table></figure>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/10.png?raw=true" alt="10"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;重启 mysql 服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># /etc/init.d/mysqld restart</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;刷新网页</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/11.png?raw=true" alt="11"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;报错</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/12.png?raw=true" alt="12"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;安装php-posix</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># yum -y install php-process</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;重启</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/13.png?raw=true" alt="13"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;点击下一步</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/14.png?raw=true" alt="14"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;选择默认  new primary server 下一步</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/15.png?raw=true" alt="15"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下一步</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/16.png?raw=true" alt="16"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下一步</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/17.png?raw=true" alt="17"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;选择模版，并点完成</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;登录，这里初始用户名和密码都为 admin</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/18.png?raw=true" alt="18"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;初次登录强制要求更改密码。注：新密码长度必须 8 位以上，必须包含大小写字母、特殊符号、数字。</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/19.png?raw=true" alt="19"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后进入监控页面</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/20.png?raw=true" alt="20"></p>
<h2 id="9-执行-poller-php-，生成图形，加入任务计划"><a href="#9-执行-poller-php-，生成图形，加入任务计划" class="headerlink" title="9.执行 poller.php ，生成图形，加入任务计划"></a>9.执行 poller.php ，生成图形，加入任务计划</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;登录有选择图形是没有显示的</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/21.png?raw=true" alt="21"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;执行脚本</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># /usr/bin/php /usr/share/cacti/poller.php</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;执行脚本时提示很多 warning</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;编辑</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># vim /etc/php.ini</span></div></pre></td></tr></table></figure>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/22.png?raw=true" alt="22"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改为</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/23.png?raw=true" alt="23"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这样再次执行就不会提示 warning 了</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/24.png?raw=true" alt="24"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;添加 cron 任务计划</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@cacti ~]<span class="comment"># crontab -e</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;增加</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">*/5 * * * * /usr/bin/php/usr/share/cacti/poller.php</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;浏览器出现图形</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%AE%89%E8%A3%85/25.png?raw=true" alt="25"></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Cacti/" rel="tag"># Cacti</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/Apache/9. Apache Prefork、Worker和Event三种MPM分析/" rel="next" title="Apache Prefork、Worker和Event三种MPM分析">
                <i class="fa fa-chevron-left"></i> Apache Prefork、Worker和Event三种MPM分析
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/Cacti/2. cacti增加客户端监控/" rel="prev" title="cacti增加客户端监控">
                cacti增加客户端监控 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-安装-epel"><span class="nav-number">1.</span> <span class="nav-text">1.安装 epel</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-安装-lamp"><span class="nav-number">2.</span> <span class="nav-text">2.安装 lamp</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-安装-cacti"><span class="nav-number">3.</span> <span class="nav-text">3.安装 cacti</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-启动服务"><span class="nav-number">4.</span> <span class="nav-text">4.启动服务</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-编辑-httpd-conf"><span class="nav-number">5.</span> <span class="nav-text">5.编辑 httpd.conf</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-导入数据创建-cacti-库"><span class="nav-number">6.</span> <span class="nav-text">6.导入数据创建 cacti 库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-编辑-cacti-配置文件"><span class="nav-number">7.</span> <span class="nav-text">7.编辑 cacti 配置文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-web-访问-cacti-并安装"><span class="nav-number">8.</span> <span class="nav-text">8.web 访问 cacti 并安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#9-执行-poller-php-，生成图形，加入任务计划"><span class="nav-number">9.</span> <span class="nav-text">9.执行 poller.php ，生成图形，加入任务计划</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
